package com.dg11185.nearshop.net.entity;

import org.json.JSONObject;

import com.dg11185.libs.ormlite.field.DatabaseField;
import com.dg11185.libs.ormlite.table.DatabaseTable;
import com.dg11185.nearshop.db.entity.DbConstant;

@DatabaseTable(tableName = DbConstant.INDUSTRY)
public class Industry {

    /** 数据库需要用到的自增主键，用于删除数据 */
    @DatabaseField(generatedId = true)
    private int id;

    @DatabaseField(width = 10)
    public String industryId = "";

    @DatabaseField(width = 20)
    public String name = "";

    @DatabaseField(width = 20)
    public String fatherId = "";

    public Industry() {

    }

    public void parseEntity(JSONObject object) {

        industryId = object.optString("industryId");
        name = object.optString("name");
        fatherId = object.optString("fatherId");
    }
}
